import java.util.*;
class Main{
    public static void main(String[] args){

        Scanner scan = new Scanner(System.in);
        while (scan.hasNextInt()){
            int n = scan.nextInt();
            int[] array = new int[3*n];
            long sum = 0;
            for (int i = 0; i < 3*n; i++){
                array[i] = scan.nextInt();
            }
            Arrays.sort(array);
            for (int i = 0; i < n; i++){
                sum += array[array.length - 2*(i + 1)];
            }
            System.out.println(sum);

        }

    }
}

class Main4{
    public static void reverse(char[] array, int begin,int end){
        while (begin < end){
            char tmp = array[begin];
            array[begin] = array[end];
            array[end] = tmp;
            begin++;
            end--;
        }
    }
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        String s = scan.nextLine();
        char[] ch = s.toCharArray();
        int len = ch.length;
        reverse(ch,0,len-1);
        int i = 0;
        while (i < len){
            int j = i;
            while (j < len && ch[j] != ' '){
                j++;
            }
            if (j < len){
                reverse(ch,i,j-1);
                i = j+1;
            }else{
                reverse(ch,i,j-1);
                i = j;
            }
        }
        String str = new String(ch);
        System.out.println(str);
    }
}

//import java.util.*;
class Main2 {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
//长度给n+1防止越界
        int[] array = new int[n+1];
        for(int i = 0;i < n;i++) {
            array[i] = scan.nextInt();
        }
        int i = 0;
        int count = 0;
        while(i < n) {
//进入非递减子序列
            if(array[i] < array[i+1]) {
                while(i < n && array[i] <= array[i+1]) {
                    i++;
                }
                count++;
                i++;
            }else if(array[i] == array[i+1]) {
                i++;
            }else {
                while(i < n && array[i] >= array[i+1]) {
                    i++;
                }
                count++;
                i++;
            }
        }
        System.out.println(count);
    }
}

//import java.util.*;
class Main1{
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        String str1 = scan.nextLine();
        String str2 = scan.nextLine();
        HashMap<Character,Integer> map = new HashMap<>();
        for (int i = 0; i < str2.length(); i++){
            if (map.get(str2.charAt(i)) == null){
                map.put(str2.charAt(i),1);
            }else{
                map.put(str2.charAt(i), map.get(str2.charAt(i)) + 1);
            }
        }
        String ret = "";
        for (int i = 0; i < str1.length(); i++){
            if (map.get(str1.charAt(i)) == null){
                ret += str1.charAt(i);
            }
        }
        System.out.println(ret);
    }

public class ZuoYe0910 {

}
}
